import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

/* Layout */
import Layout from '@/layout'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Layout,
    redirect: '/home',
    children: [
      {
        path: '/home',
        name: 'home',
        component: () => import('@/views/Home'),
        meta: {
          title: '首页',
        },
      },
      {
        path: '/about',
        name: 'about',
        component: () => import('@/views/About'),
        meta: {
          title: '关于',
        },
      },
    ],
  },
]

const router = new VueRouter({
  routes,
})

export default router
